import { getToken } from '@/utils/auth'
import { getRoleList } from "@/api/admin/user.js";
const defaultSettings = require('../../settings.js')

export default (_self) => {

    return {
        // editBtn:false,
        // delBtn:false,
        index: true,
        indexLabel: '序号',
        align: 'center',
        headerAlign: 'center',
        border: true,
        dialogWidth: '40%',
        stripe: false,
        props: {
            label: 'label',
            value: 'value'
        },
        column: [{
                tip: '图片尺寸为:宽500px，高400px',
                rules: [{
                    required: true,
                    message: "请上传分享图",
                    trigger: "blur"
                }],
                data: {
                    key: getToken()
                },
                // slot: true,
                label: '分享图',
                prop: 'img',
                type: 'upload',
                listType: 'picture-img',
                span: 12,
                row: true,
                propsHttp: {
                    res: 'datas',
                    url:'url'
                },
                action: defaultSettings.uploadImg,

            },
            {
                label: "标题",
                prop: "title",
                row: true,
                span: 12,
                rules: [{
                    required: true,
                    message: "请输入标题",
                    trigger: "blur"
                }]
            },
            {
                label: "简介",
                prop: "intro",
                row: true,
                span: 24,
                type: 'textarea'
            },
            {
                width: 100,
                label: "跳转页面",
                prop: "applets_page_id",
                type: "select",
                dicUrl: `${defaultSettings.baseApi}/applets_page/get_applets_page_list?key=${getToken()}`,
                span: 12,
                props: {
                    label: 'name',
                    value: 'id',
                    res: 'datas.data'
                }
            },
            {
                label: "参数",
                prop: "parameter",
                row: true,
                span: 12
            },
            {
                row: true,
                span: 12,
                label: "状态",
                prop: "state",
                type: 'select',
                slot: true,
                value: 1,
                dicData: [{
                    label: '启用',
                    value: 1
                }, {
                    label: '禁用',
                    value: 2
                }],
                rules: [{
                    required: true,
                    message: '请选择状态',
                    trigger: 'change'
                }]
            },
        ],
    }
}